package HiveUDF;

import org.apache.hadoop.hive.ql.exec.UDF;

//341125199704215417
public class JiaMiUDF extends UDF {
    static String sfz_number = "341125199704215417";

    public String evaluate(String sfz) {

        String jiami = "1";
        String df = sfz.substring(14,15);
        System.out.println(df);
        if (df == "5") {
            jiami= sfz.substring(0, 13) + "f" + sfz.substring(15, 17);
        }
        return jiami;
    }


    public static void main(String[] args) {
        System.out.println(new JiaMiUDF().evaluate(sfz_number));
    }
}
